<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "tmall1.member_address".
 *
 * @property integer $uid
 * @property integer $member_uid
 * @property integer $s1_uid
 * @property integer $s2_uid
 * @property integer $s3_uid
 * @property string $consignee
 * @property string $s1
 * @property string $s2
 * @property string $s3
 * @property string $address
 * @property string $zipcode
 * @property string $cell
 * @property string $tel1
 * @property string $tel2
 * @property string $tel3
 * @property string $order_email
 * @property integer $is_default
 * @property integer $addtime
 */
class MemberAddress extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tmall1.member_address';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['member_uid', 's1_uid', 's2_uid', 's3_uid', 'is_default', 'addtime'], 'integer'],
            [['consignee'], 'string', 'max' => 60],
            [['s1', 'cell', 'tel1', 'tel2', 'tel3'], 'string', 'max' => 15],
            [['s2', 's3'], 'string', 'max' => 30],
            [['address'], 'string', 'max' => 255],
            [['zipcode'], 'string', 'max' => 6],
            [['order_email'], 'string', 'max' => 120],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'uid' => 'Uid',
            'member_uid' => '会员uid',
            's1_uid' => '省id',
            's2_uid' => '市id',
            's3_uid' => '区县id',
            'consignee' => '收货人',
            's1' => '省',
            's2' => '市',
            's3' => '区县',
            'address' => '详细地址',
            'zipcode' => '邮编',
            'cell' => '手机号',
            'tel1' => '固定电话区号',
            'tel2' => '固定电话号码',
            'tel3' => '固定电话分机号',
            'order_email' => 'Order Email',
            'is_default' => '是否常用地址 1是 0否',
            'addtime' => '添加时间',
            'express_charge'=>'快递费',
        ];
    }

    /**
     * @inheritdoc
     * @return \services\models\MemberAddressQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \services\models\MemberAddressQuery(get_called_class());
    }
}
